package edu.sctu.xuping.month05.day20150512;

/**
 * Created by user16 on 2015/5/12.
 */
public class TextChildTwo extends StudentsInformation implements JudgeInterface {
    public TextChildTwo(TextOne[] array) {
        super(array);
    }

    int m = 0;
    int n  = 0;

    @Override
    public void getSysyTem() {
        for (int i = 0; i < array.length; i++) {

            if (array[i].getGrade() > 60 && array[i].getSex().equals("男")) {
                m++;
                System.out.println(array[i].name + array[i].getNumber() + array[i].getAddress());


            }
        }
        System.out.println("人数：" + m);
        System.out.println("年龄大于age的人数及信息：");
    }


    @Override
    public void judgeAge(int age, int grade) {
        for (int i = 0; i < array.length; i++) {

            if (array[i].getAge() > age) {
                System.out.println(array[i].getName() + array[i].getAge() + array[i].getAddress() + array[i].getNumber());
                n++;
            }
        }
        System.out.println("总人数为：" + n + "人");
    }
}
